package com.giscloud.limp.entity;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.util.ArrayList;
import java.util.Arrays;
/**
 * 案件提醒
 * 
 * @author giscloud
 * @email giscloud@giscloud.com
 * @date 2020-06-10 14:25:30
 */
@Data
public class CaseWarn implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 案件提醒ID
	 */
   private Integer caseWarnId;
	/**
	 * 案件ID
	 */
   private Integer caseId;
	/**
	 * 案件名称
	 */
   private String caseName;
	/**
	 * 诉讼阶段 1|一审;2|二审;3|再审;4|执行;5|诉讼结案
	 */
   private Integer litigationStage;
	/**
	 * 提醒日期
	 */
	private Date warnDate;
	/**
	 * 提醒内容
	 */
	private String warnContent;

   private Integer statusCd;

   private Integer createdStaffId;

   private Date createdDt;

   private Integer operateStaffId;

   private Date version;

public enum Column {
						caseWarnId("case_warn_id","caseWarnId","INTEGER",false),
								caseId("case_id","caseId","INTEGER",false),
								caseName("case_name","caseName","VARCHAR",false),
								litigationStage("litigation_stage","litigationStage","INTEGER",false),
								warnDate("warn_date","warnDate","DATE",false),
								warnContent("warn_content","warnContent","VARCHAR",false),
								statusCd("status_cd","statusCd","INTEGER",false),
								createdStaffId("created_staff_id","createdStaffId","INTEGER",false),
								createdDt("created_dt","createdDt","TIMESTAMP",false),
								operateStaffId("operate_staff_id","operateStaffId","INTEGER",false),
								version("version","version","TIMESTAMP",false);
	    		private static final String BEGINNING_DELIMITER = "`";
	private static final String ENDING_DELIMITER = "`";
	private final String column;
	private final boolean isColumnNameDelimited;
	private final String javaProperty;
	private final String jdbcType;
	public String value() {
		return this.column;
	}
	public String getValue() {
		return this.column;
	}
	public String getJavaProperty() {
		return this.javaProperty;
	}
	public String getJdbcType() {
		return this.jdbcType;
	}
	Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
		this.column = column;
		this.javaProperty = javaProperty;
		this.jdbcType = jdbcType;
		this.isColumnNameDelimited = isColumnNameDelimited;
	}
	public String desc() {
		return this.getEscapedColumnName() + " DESC";
	}
	public String asc() {
		return this.getEscapedColumnName() + " ASC";
	}
	public static Column[] excludes(Column ... excludes) {
		ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
		if (excludes != null && excludes.length > 0) {
			columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
		}
		return columns.toArray(new Column[]{});
	}
	public String getEscapedColumnName() {
		if (this.isColumnNameDelimited) {
			return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
		} else {
			return this.column;
		}
	}
	public String getAliasedEscapedColumnName() {
		return this.getEscapedColumnName();
	}
  }

}
